<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>激活码使用详情 - frm</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="../../Ryancss/activation_code_usage_details.css" rel="stylesheet" type="text/css"/>

    </head>
    <body>

<section class="aui-scrollView">


                <div class="aui-extreme">
				
				
				
                    <div class="aui-extreme-item">
                        <div class="aui-flex aui-flex-pic">
                            <div class="aui-flex-box">
                                <h2>体验 <span id="experience_quota"></span> </h2>
                            </div>
                        </div>
                        <div class="aui-palace">
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 class="red" id="experience_total"> 0 </h2>
                                    <p>生成总数</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="experience_used"> 0 </h2>
                                    <p>已用数量</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="experience_proportion"> 0% </h2>
                                    <p>激活率</p>
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="aui-extreme-item">
                        <div class="aui-flex aui-flex-pic">
                            <div class="aui-flex-box">
                                <h2>一月  <span id="one_month_quota"></span> </h2>
                            </div>
                        </div>
                        <div class="aui-palace">
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 class="red" id="one_month_total"> 0 </h2>
                                    <p>生成总数</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="one_month_used"> 0 </h2>
                                    <p>已用数量</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="one_month_proportion"> 0% </h2>
                                    <p>激活率</p>
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="aui-extreme-item">
                        <div class="aui-flex aui-flex-pic">
                            <div class="aui-flex-box">
                                <h2>三月  <span id="three_month_quota"></span> </h2>
                            </div>
                        </div>
                        <div class="aui-palace">
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 class="red" id="three_month_total"> 0 </h2>
                                    <p>生成总数</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="three_month_used"> 0 </h2>
                                    <p>已用数量</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="three_month_proportion"> 0% </h2>
                                    <p>激活率</p>
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="aui-extreme-item">
                        <div class="aui-flex aui-flex-pic">
                            <div class="aui-flex-box">
                                <h2>半年 <span id="half_a_year_quota"></span> </h2>
                            </div>
                        </div>
                        <div class="aui-palace">
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 class="red" id="half_a_year_total"> 0 </h2>
                                    <p>生成总数</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="half_a_year_used"> 0 </h2>
                                    <p>已用数量</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="half_a_year_proportion"> 0% </h2>
                                    <p>激活率</p>
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="aui-extreme-item">
                        <div class="aui-flex aui-flex-pic">
                            <div class="aui-flex-box">
                                <h2>一年  <span id="one_year_quota"></span> </h2>
                            </div>
                        </div>
                        <div class="aui-palace">
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 class="red" id="one_year_total"> 0 </h2>
                                    <p>生成总数</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="one_year_used"> 0 </h2>
                                    <p>已用数量</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="one_year_proportion"> 0% </h2>
                                    <p>激活率</p>
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="aui-extreme-item">
                        <div class="aui-flex aui-flex-pic">
                            <div class="aui-flex-box">
                                <h2>永久  <span id="permanent_quota"></span> </h2>
                            </div>
                        </div>
                        <div class="aui-palace">
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 class="red" id="permanent_total"> 0 </h2>
                                    <p>生成总数</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="permanent_used"> 0 </h2>
                                    <p>已用数量</p>
                                </div>
                            </a>
                            <a class="aui-palace-grid">
                                <div class="aui-palace-grid-text">
                                    <h2 id="permanent_proportion"> 0% </h2>
                                    <p>激活率</p>
                                </div>
                            </a>
                        </div>
                    </div>

                </div>
            </section>



    </body>  
	
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript">
	var api_url = localStorage.getItem('api_url');

	apiready = function(){
		
		
	/*	
				api.showProgress({
				    title: '正在加载',
				    text: '请稍等',
				    modal: false
				});
				
 	*/
				

		GetData();
   
						// 网络状态
		api.addEventListener({
			name:'offline'
		}, function(ret, err){        

			api.toast({
			msg : '网络连接异常',
			duration : 5000,
			location : 'middle' 
			});

		});
		

		api.addEventListener({
			name:'online'
		}, function(ret, err){        
		
			  api.toast({
			  msg : '已经连接网络',
			  duration : 2000,
			  location : 'middle' 
			  });
				  
			//获取数据
			   GetData();

				  
		});	
					
	}
	
	


    
function GetData(){

		api.ajax({
            url: api_url+'/agent/agent/activation_code_usage_details.html',
			method: 'get',
			data: {
				values: {
					key: 'ikmovie.xyz',   //安全码
					uid: localStorage.getItem('user_id')
				}
			}
		}, function(ret, err) {
		
						if(ret) {
						
										if(ret.code == 1){

								
												localStorage.setItem('quota',ret.quota);
												if(localStorage.getItem('quota') > 0){
													experience_quota.innerHTML = '<em>未使用激活码限额 '+localStorage.getItem('quota')+'</em>';	
													one_month_quota.innerHTML = '<em>未使用激活码限额 '+localStorage.getItem('quota')+'</em>';	
													three_month_quota.innerHTML = '<em>未使用激活码限额 '+localStorage.getItem('quota')+'</em>';	
													half_a_year_quota.innerHTML = '<em>未使用激活码限额 '+localStorage.getItem('quota')+'</em>';	
													one_year_quota.innerHTML = '<em>未使用激活码限额 '+localStorage.getItem('quota')+'</em>';	
													permanent_quota.innerHTML = '<em>未使用激活码限额 '+localStorage.getItem('quota')+'</em>';	
												}
										
										
												localStorage.setItem('experience_total',ret.experience_total);
												localStorage.setItem('experience_used',ret.experience_used);
												localStorage.setItem('experience_proportion',ret.experience_proportion);
												experience_total.innerHTML = localStorage.getItem('experience_total');	
												experience_used.innerHTML = localStorage.getItem('experience_used');	
												experience_proportion.innerHTML = localStorage.getItem('experience_proportion')+'%';	
												
												localStorage.setItem('one_month_total',ret.one_month_total);
												localStorage.setItem('one_month_used',ret.one_month_used);
												localStorage.setItem('one_month_proportion',ret.one_month_proportion);
												one_month_total.innerHTML = localStorage.getItem('one_month_total');	
												one_month_used.innerHTML = localStorage.getItem('one_month_used');	
												one_month_proportion.innerHTML = localStorage.getItem('one_month_proportion')+'%';	
												
												localStorage.setItem('three_month_total',ret.three_month_total);
												localStorage.setItem('three_month_used',ret.three_month_used);
												localStorage.setItem('three_month_proportion',ret.three_month_proportion);
												three_month_total.innerHTML = localStorage.getItem('three_month_total');	
												three_month_used.innerHTML = localStorage.getItem('three_month_used');	
												three_month_proportion.innerHTML = localStorage.getItem('three_month_proportion')+'%';	
												
												localStorage.setItem('half_a_year_total',ret.half_a_year_total);
												localStorage.setItem('half_a_year_used',ret.half_a_year_used);
												localStorage.setItem('half_a_year_proportion',ret.half_a_year_proportion);
												half_a_year_total.innerHTML = localStorage.getItem('half_a_year_total');	
												half_a_year_used.innerHTML = localStorage.getItem('half_a_year_used');	
												half_a_year_proportion.innerHTML = localStorage.getItem('half_a_year_proportion')+'%';	
												
												localStorage.setItem('one_year_total',ret.one_year_total);
												localStorage.setItem('one_year_used',ret.one_year_used);
												localStorage.setItem('one_year_proportion',ret.one_year_proportion);
												one_year_total.innerHTML = localStorage.getItem('one_year_total');	
												one_year_used.innerHTML = localStorage.getItem('one_year_used');	
												one_year_proportion.innerHTML = localStorage.getItem('one_year_proportion')+'%';	
												
												localStorage.setItem('permanent_total',ret.permanent_total);
												localStorage.setItem('permanent_used',ret.permanent_used);
												localStorage.setItem('permanent_proportion',ret.permanent_proportion);
												permanent_total.innerHTML = localStorage.getItem('permanent_total');	
												permanent_used.innerHTML = localStorage.getItem('permanent_used');	
												permanent_proportion.innerHTML = localStorage.getItem('permanent_proportion')+'%';	
												
										}else{
										
										
											api.toast({
												msg: '数据获取失败',
												duration: 3000,
											location : 'middle' 
											});
										
										}
							
							
							}
				
					api.hideProgress(); 
				 
		}
			


		); 

   
   /////判断




}




</script>
	
	
	
</html>